package io.renren.modules.hospital.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.hospital.dao.EmrGhInfoDao;
import io.renren.modules.hospital.entity.EmrGhInfoEntity;
import io.renren.modules.hospital.service.EmrGhInfoService;


@Service("emrGhInfoService")
public class EmrGhInfoServiceImpl extends ServiceImpl<EmrGhInfoDao, EmrGhInfoEntity> implements EmrGhInfoService {


    @Autowired
    EmrGhInfoDao ghInfoDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<EmrGhInfoEntity> page = this.page(
                new Query<EmrGhInfoEntity>().getPage(params),
                new QueryWrapper<EmrGhInfoEntity>()
        );

        return new PageUtils(page);
    }

    /**
     * 根据患者id查找该患者的所有挂号记录
     * @param hzId 患者编号
     * @return 挂号记录列表
     */
    public List<EmrGhInfoEntity> getGhListByHzId(Integer hzId){
        return ghInfoDao.getGhListByHzId(hzId);
    }



    /**
     * 根据医生id查找该医生的当天所有挂号记录
     * @param ysId 医生编号
     * @return 挂号记录列表
     */
    public List<EmrGhInfoEntity> getGhListByYsId(Integer ysId){
        return ghInfoDao.getGhListByYsId(ysId);
    }

    @Override
    public List<EmrGhInfoEntity> getAllGhList(int start, int size) {
        return ghInfoDao.getAllGhList(start,size);
    }

    @Override
    public Integer getAllNum() {
        return ghInfoDao.getAllNum();
    }
}
